<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta charset="utf-8"/>

    <meta name="keywords" content="{$Think.CONFIG.keywords}"/>
    <meta name="description" content="{$Think.CONFIG.description}"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"/>

    {include file="public/head" /}

</head>
<body>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <div class="main-container-inner">
        <a class="menu-toggler" id="menu-toggler" href="#">
            <span class="menu-text"></span>
        </a>
        {include file="public/nav"/}


        {include file="public/menu"/}

        <div class="main-content">
            {include file="public/breadcrumb"/}

            <div class="page-content">
                <div class="row">
                    <div class="cf">
                        <!--<a class="btn btn-info" href="{:Url('addFront')}">新增</a>-->
                        <!--数据筛选表单-->
                        <form class="form-inline fmWorkQuery-hook">
                            <input class="input-large" name="car_num" placeholder="车牌号"/>
                            <input class="input-small" name="operator.name" placeholder="操作人"/>
                            <button type="button" class="btn btn-info btn-sm" onclick="index.search();">
                                <i class="fa fa-search bigger-110"></i>
                                查找
                            </button>
                            <button type="button" class="btn btn-primary btn-sm" onclick="index.searchNull();">
                                <i class="fa fa-remove bigger-110"></i>
                                清空
                            </button>
                        </form>
                    </div>

                    <div class="space-4"></div>

                    <table id="tbWork"></table>
                    <div id="tbWorkPager"></div>

                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div><!-- /.main-content -->

    </div><!-- /.main-container-inner -->

    <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
        <i class="fa fa-angle-double-up fa-only bigger-110"></i>
    </a>
</div>
</body>
{include file="public/footerjs"/}
<script src="__ADMIN__/ace/js/bootbox.min.js"></script>

<script>

    (function () {
        $(function () {
            //加载数据
            var $tbWork = $('#tbWork'), $pager = $('#tbWorkPager');
            $tbWork.jqGrid({
                url: '{:url("car/getMoneyLog")}',
                datatype: 'json',
                mttype: 'post',
                colNames: ['车牌号', '充值前', '充值金额', '充值后', '充值日期', '操作人员'],
                colModel: [
                    {name: 'car_num', index: 'car_num', width: '100', align: 'center'},
                    {name: 'moneyleft', index: 'moneyleft', width: '100', align: 'center'},
                    {name: 'charge', index: 'charge', width: '100', align: 'center'},
                    {
                        name: 'moneyleft', index: 'moneyleft', width: '100', align: 'center',
                        formatter: function (value, options, obj) {
                            return value + obj.charge;
                        }
                    },
                    {
                        name: 'inserttime', index: 'inserttime', width: '100', align: 'center',
                        formatter: function (value) {
                            var date = new Date(parseInt(value) * 1000);
                            return ittaoli.dateFormat(date, "yyyy-MM-dd hh:mm:ss");
                        }
                    },
                    {name: 'operator.name', index: 'operator.name', width: '100', align: 'center'},

                ],
                height: 'auto',
                pager: '#tbWorkPager',
                viewrecords: true,
                rowNum: 10,
                rowList: [10, 20, 40],
                autowidth: true
            });
            // 隐藏水平方向滚动条
            $tbWork.closest(".ui-jqgrid-bdiv").css({"overflow-x": "hidden"});
        });
        index = {
            search: function () {
                var $fmQuery = $('.fmWorkQuery-hook');
                var param = ittaoli.serializeObject($fmQuery);
                $('#tbWork').jqGrid('setGridParam', {
                    postData: {q: JSON.stringify(param)},
                    page: 1
                }).trigger("reloadGrid");
            },
            searchNull: function () {
                $('.fmWorkQuery-hook input').val('');
                var param = {};
                $('#tbWork').jqGrid('setGridParam', {
                    postData: {q: JSON.stringify(param)},
                    page: 1
                }).trigger("reloadGrid");
            },
        }
    }());
</script>

{include file="public/foot" /}
